package org.mountainpunch.ds.sparsematrix;

/**
 * An interface for any data type for the SparseMatrix which needs to do arithmetic
 * operations on other data type of the same type.
 * @author siddharth
 */
public interface MatrixDataOperable {

  /**
   * Multiplies the data contained in this data type with another data in the
   * corresponding data type.
   * @param mdata the data type
   * @return the product of this.data * mdata.data
   */
  public MatrixDataOperable multiply(MatrixDataOperable mdata);

  /**
   * Adds the data contained in this data type with another data in the
   * corresponding data type.
   * @param mdata the data type
   * @return the product of this.data + mdata.data
   */
  public MatrixDataOperable add(MatrixDataOperable mdata);

  /**
   * Subtracts the data contained in this data type with another data in the
   * corresponding data type.
   * @param mdata the data type
   * @return the product of this.data - mdata.data
   */
  public MatrixDataOperable subtract(MatrixDataOperable mdata);

  /**
   * Interpolates between the data contained in this data type and another
   * data in the corresponding data type.
   * @param mdata the data type
   * @return the product of this.data + t*(mdata.data - this.data)
   */
  public MatrixDataOperable interpolate(MatrixDataOperable mdata, float t);

  /**
   * Negates the data.
   * @return the negated {@code MatrixDataOperable}.
   */
  public MatrixDataOperable negate();
}
